package com.dyh.quickdemo.demos.beanLife;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/*
@Author=Joey Wheeler
@Date=2021/5/7 19:31
*/
@Component
@Slf4j
public class LifeDemoBean implements InitializingBean, FactoryBean<LDB> {


    @Override
    public LDB getObject() throws Exception {
        log.info("getObject");
        return new LDB();
    }

    @Override
    public Class<?> getObjectType() {
        return LDB.class;
    }


    @Override
    public void afterPropertiesSet() throws Exception {
        log.info("afterPropertiesSet");
    }

    @PostConstruct
    public void pc(){
        log.info("pc");
    }
}
